package com.itheima.wisdomnext.entity;

import java.util.Date;
import java.util.List;

public class CommentShow {
    private Integer id;        // 评论 ID
    private Integer postId;    // 所属帖子 ID
    private Integer userId;    // 用户 ID
    private Users user;        // 用户信息
    private String content;    // 评论内容
    private Integer parentId;  // 父评论 ID（如果是回复则有值，否则为 null）
    private Integer likes;     // 点赞数量
    private Date createdAt;    // 创建时间
    private boolean likedByUser; // 是否被该用户点赞
    private Integer replyCount; // 新增字段，存储回复数
    private List<CommentShow> replies; // 新增字段，存储多个回复评论
    // 无参构造方法
    public CommentShow() {}

    // 全参构造方法
    public CommentShow(Integer id, Integer postId, Integer userId, Users user, String content, Integer parentId, Integer likes, Date createdAt) {
        this.id = id;
        this.postId = postId;
        this.userId = userId;
        this.user = user;
        this.content = content;
        this.parentId = parentId;
        this.likes = likes;
        this.createdAt = createdAt;
    }

    // Getter 和 Setter 方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPostId() {
        return postId;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Users getUser() {
        return user;
    }

    public void setUser(Users user) {
        this.user = user;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getLikes() {
        return likes;
    }

    public void setLikes(Integer likes) {
        this.likes = likes;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Integer getReplyCount() {
        return replyCount;
    }

    public void setReplyCount(Integer replyCount) {
        this.replyCount = replyCount;
    }

    public List<CommentShow> getReplies() {
        return replies;
    }

    public void setReplies(List<CommentShow> replies) {
        this.replies = replies;
    }

    public boolean isLikedByUser() {
        return likedByUser;
    }

    public void setLikedByUser(boolean likedByUser) {
        this.likedByUser = likedByUser;
    }
}
